home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2002 November / SGI Freeware 2002 November - Disc 1.iso / dist / fw_exmh.idb / usr / freeware / lib / exmh-2.5 / source.tcl.z / source.tcl
Text File  |  2002-07-08  |  940b  |  32 lines

  1. if {$exmh(sourceHook) && [info command source-orig] ==  ""} {
  2.     rename source source-orig
  3.     proc source {file} {
  4.      global SourceHook
  5.      set result [uplevel 1 [list source-orig $file]]
  6.      set fn [file rootname [file tail $file]]
  7.      if [info exists SourceHook($fn)] {
  8.         if [catch {uplevel 1 $SourceHook($fn)} err] {
  9.         Exmh_Status "Error in source hook for $fn: $err" red
  10.         }
  11.      }
  12.      return $result
  13.     }
  14. }
  15.  
  16. # Scan users' exmh directory for files called xxx.patch
  17. # Assume that xxx.patch is an extension/patch for xxx.tcl in the main
  18. # Exmh source tree.
  19. # (Better not use ".tcl" for a file extension because we want to hide the
  20. # patches from auto_mkindex).
  21.  
  22. proc SourceHook_Init {} {
  23.     global exmh SourceHook
  24.     set patches [glob -nocomplain $exmh(userLibrary)/*.patch]
  25.     foreach file $patches {
  26.     set fn [file rootname [file tail $file]]
  27.     Exmh_Debug "Arm Patch $fn for $file "
  28.     set SourceHook($fn) [list source-orig $file]
  29.     }
  30. }
  31.  
  32.